<?php

namespace app\admin\model;

use app\webapi\common\BaseModel;

class ArticleModel extends BaseModel
{
    protected $table = 'jq_website_article_';
    protected $suffix = '0';

    public function setSuffix(string $suffix)
    {
        $suffix=$suffix%2;
        return parent::setSuffix($suffix);
    }


    public function getStatusTextAttr($value, $data)
    {
        $status = [0 => '待发布', 1 => '已发布', 2 => '已禁用'];
        return $status[$data['status']];
    }

    public function getIsShowIndexTextAttr($value, $data)
    {
        $status = [0 => '否', 1 => '是'];
        return $status[$data['is_show_index']];
    }

    public function getIsShowListTextAttr($value, $data)
    {
        $status = [0 => '否', 1 => '是'];
        return $status[$data['is_show_list']];
    }

}